package de.andreavicentini.teatralia.pages.repertoire;

import org.magiclabs.htmlx.TextStructure;
import org.magiclabs.htmlx.TextStructure.TextKey;

import de.andreavicentini.teatralia.pages.Person;
import de.andreavicentini.teatralia.pages.TDate;

public class Author extends Person implements Comparable<Author> {

	public Author(String firstName, String lastName, Sex sex,
			TDate birthDay, String city, 
			TDate death, 
			String cityDeath, TextStructure.TextKey description) {
		super(firstName, lastName, sex, city, Nationality.italian);
		this.birthDay = birthDay;
		this.death = death;
		this.cityDeath = cityDeath;
		this.description = description;
	}
	
	private final TDate birthDay;
	public TDate getBirthDate() {
		return birthDay;
	}
	
	private final String cityDeath;
	public String getCityDeath() {
		return cityDeath;
	}
	
	private final TDate death;
	public TDate getDeath() {
		return death;
	}
	
	private final TextKey description;
	public TextKey getDescription() {
		return description;
	}
	
	public int compareTo(Author o) {
		return this.lastName.compareToIgnoreCase(o.getLastName());
	}
	
	@Override
	public String toString() {
		return this.getFirstName() + " " + this.getLastName();
	}

}
